The diversification of species into separate forms that each adapt to occupy a specific environmental niche.